package com.blog.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;

import com.blog.domain.Draft;

/**
 * Created by youpengfei on 15/2/9.
 */
public interface DraftDAO extends JpaRepository<Draft, Long> {
    /**
     * 获取到文章所有草稿
     *
     * @param title 名称
     *
     * @return
     */
    public List<Draft> findByTitle(String title);

    /**
     * 获取到最新的草稿
     *
     * @param title 标题
     *
     * @return
     */
    public Draft findTop1ByTitleOrderByCreateTimeDesc(String title);
}
